package com.wdb007.venus.svc.facade;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.wdb007.venus.svc.facade.charge.model.CalcPayAmountDTO;
import com.wdb007.venus.svc.facade.charge.model.CalcPayAmountResultDTO;
import com.wdb007.venus.svc.facade.charge.model.ChargeAmountDTO;
import com.wdb007.venus.svc.facade.charge.model.PaymentChargeAmountDTO;
import com.wdb007.venus.svc.facade.charge.model.PaymentVIPCardDTO;
import com.wdb007.venus.svc.facade.charge.model.PaymentVIPCardResultDTO;
import com.wdb007.venus.svc.facade.charge.model.PlaceOrderReqDTO;
import com.wdb007.venus.svc.facade.charge.model.PlaceOrderRspDTO;
import com.wdb007.venus.svc.facade.charge.model.PrepareBuyBookReqDTO;
import com.wdb007.venus.svc.facade.charge.model.PrepareBuyBookResDTO;
import com.wdb007.venus.svc.facade.charge.model.QueryPayStatusDTO;
import com.wdb007.venus.svc.facade.charge.model.RefundPyStatusDTO;
import com.wdb007.venus.svc.facade.charge.model.UserRefundDTO;
import com.wdb007.venus.svc.facade.charge.model.VIPAmountRspDTO;
import com.wdb007.venus.svc.facade.charge.model.WxUserRelationDTO;
import com.wdb007.venus.svc.facade.exception.BizException;
import com.wdb007.venus.svc.facade.model.VenusSvcResp;
import com.wdb007.venus.svc.facade.user.model.UserAccessLogDTO;
import com.wdb007.venus.svc.facade.user.model.UserInfoDTO;

public interface UserChargeService {
	/**
	 * 下单接口
	 * @param placeOrder
	 * @return
	 */
	VenusSvcResp<PlaceOrderRspDTO> placeOrder(PlaceOrderReqDTO placeOrder) throws BizException;
	/**
	 * 签名校验
	 * @param params
	 * @return
	 */
	boolean rsaCheckV1(Map<String,String> params) throws BizException;
	/**
	 * 业务性校验
	 * @param params
	 * @return
	 */
	boolean bizHandle(Map<String,String> params) throws BizException;
	/**
	 * 
	 * @Method:weChatNotify
	 * @Description:微信支付结果通知业务处理
	 * @Time 2017年8月24日 下午3:46:48
	 * @author: Tom
	 * @return
	 */
	boolean weChatNotify(Map<String, String> params) throws BizException;
	/**
	 * 
	 * @Method:queryPayStatus
	 * @Description:根据UserId查询用户最新订单
	 * @Time 2017年8月30日 下午2:08:10
	 * @author: Tom
	 * @param userId
	 * @return
	 * @throws BizException
	 */
	QueryPayStatusDTO queryPayStatus(long userId) throws BizException;
	
	RefundPyStatusDTO refund(Long userid) throws BizException;
	
	RefundPyStatusDTO refund(String outTradeNo) throws BizException;
	
	void downloadBill(String billDate) throws BizException;
	/**
	 * 
	 * @Method:refundSubmit
	 * @Description:用户退款提交接口
	 * @Time 2017年11月2日 下午3:51:24
	 * @author: Tom
	 * @param userid
	 * @return
	 */
	RefundPyStatusDTO refundSubmit(Long userid) throws BizException;
	
	RefundPyStatusDTO refundSubmit(UserRefundDTO userRefund) throws BizException;
	
	void exportReadyForRefund(Date refundDate) throws BizException;
	
	Map<String, String> getOpenId(String code, String userid) throws BizException;

	Map<String, Object> getUserinfoByWxCode(String code, UserAccessLogDTO accessLog) throws BizException;
	String getSessionKey(String id);
	PlaceOrderRspDTO payment(PlaceOrderReqDTO placeOrder) throws BizException;
	
	VIPAmountRspDTO getVIPAmountList(Long userid) throws BizException;
	
	void saveWxUserInfo(WxUserRelationDTO relation) throws BizException;
	
	public List<UserInfoDTO> getUserinfoByUnionid(String unionid, Long userid, String mobileNo);
	
	/**
	 * 计算支付金额
	 * @param calcPayAmount
	 * @return
	 * @throws BizException
	 */
	CalcPayAmountResultDTO calcPayAmount(CalcPayAmountDTO calcPayAmount) throws BizException;
	
	PaymentVIPCardResultDTO paymentVIPCard(PaymentVIPCardDTO paymentVIPCard) throws BizException;
	/**
	 * 根据userid和appid查询对应wx_user_relation
	 * @param userid
	 * @param appid
	 * @return
	 */
	public WxUserRelationDTO getWxInfoByUserid(Long userid, String appid);
	
	Long getUseridByWxToken(String usertoken);
	
	List<ChargeAmountDTO> getChargeAmountListV2(Long userid) throws BizException;
	
	PaymentVIPCardResultDTO paymentChargeAmount(PaymentChargeAmountDTO pcaDTO) throws BizException;

	void updateWxUserInfoById(WxUserRelationDTO dto);
	
	void cancelPayment(Long userid) throws BizException;
	
	PrepareBuyBookResDTO prepareBuyBook(PrepareBuyBookReqDTO prepareBuyBookReq) throws BizException;
	
}
